/*jslint browser: true, nomen: true, es5: true*/
/*global $, jQuery, window, requirejs, require, define*/
(function (factory) {
    "use strict";
	if (typeof define === "function" && define.amd) {
		// AMD. Register as an anonymous module.
		define(
            "lhmcv",
            [
                "lhmcv.public", "lhmcv.config", "lhmcv.class", "lhmcv.indexedDB", "lhmcv.ajaxDB",
                "lhmcv.model", "lhmcv.element", "lhmcv.view"
            ],
            factory
        );
	} else {
        // Browser globals
        var lhmcv = window.lhmcv = window.lhmcv || {};
        if (lhmcv.hasOwnProperty("public")
                && lhmcv.hasOwnProperty("config")
                && lhmcv.hasOwnProperty("class")
                && lhmcv.hasOwnProperty("indexedDB")
                && lhmcv.hasOwnProperty("ajaxDB")
                && lhmcv.hasOwnProperty("model")
                && lhmcv.hasOwnProperty("element")
                && lhmcv.hasOwnProperty("view")
                ) {
            window.lhmcv = factory(
                lhmcv.public,
                lhmcv.config,
                lhmcv.class,
                lhmcv.indexedDB,
                lhmcv.ajaxDB,
                lhmcv.model,
                lhmcv.element,
                lhmcv.view
            );
        } else {
            throw new Error("One of dependants of lhmcv is missing.");
        }
	}
}(function (
    iPublic,
    config,
    iClass,
    indexedDB,
    ajaxDB,
    iModel,
    iTemplate,
    iView
) {
    "use strict";
    var lhmcv = {};
    lhmcv.config = config;
    lhmcv.indexedDB = indexedDB;
    lhmcv.ajaxDB = ajaxDB;
    lhmcv.model = iModel;
    lhmcv.template = iTemplate;
    lhmcv.view = iView;
    return lhmcv;
}));